package com.eiletxie.springcloud.service;

import com.eiletxie.springcloud.entities.CommonResult;
import com.eiletxie.springcloud.entities.Payment;
import com.eiletxie.springcloud.entities.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Author EiletXie
 * @Since 2020/3/11 13:35
 */
@Component
@FeignClient(value = "CLOUD-PROVIDER-HYSTRIX-PAYMENT")
public interface PaymentFeignService {

    @GetMapping(value="/payment/hystrix/ok/{id}")
    public String getPaymentById(@PathVariable("id") Long id);

    @GetMapping(value = "/payment/hystrix/timeout/{id}")
    public String paymentFeignTimeout(@PathVariable("id") Long id);

    @PostMapping(value = "/payment/feign/postResonse")
    public String postResonse(@RequestBody String test);


    @PostMapping(value = "/payment/feign/post1")
    public String post1(@RequestBody User user);
    @GetMapping(value = "/payment/circuit/{id}")
    String circuit(@PathVariable("id") Integer id);
}
